#ifndef EVENT_POLLER_H
#define EVENT_POLLER_H

#include <SDL.h>
#include <list>
#include "Singleton.h"

namespace Engine
{
	class EventHandler;

	class EventPoller : public NonCopyable
	{
		private:
			friend class Singleton <EventPoller>;

			typedef std::list <EventHandler*> HandlerList;
			HandlerList m_handlers;

			SDL_Event* m_event;
			EventPoller(): m_event(0){}

		public:
			bool Initialize();
			void Update();

			void AddHandler(EventHandler* e);
			void RemoveHandler(EventHandler* e);
			void RemoveAllHandlers();
			~EventPoller();
	};

	typedef Singleton <EventPoller> TheEventPoller;
}

#endif